package com.zhl.study.service;

import org.apache.ibatis.session.ResultContext;
import org.apache.ibatis.session.ResultHandler;

/**
 * @description TODO
 * @Author: z156940l@outlook.com
 * @className CustomResultHandler
 * @Date: 2023/3/21 23:57
 */
public class CustomResultHandler implements ResultHandler {
    private final DownloadProcessor downloadProcessor;

    public CustomResultHandler(
            DownloadProcessor downloadProcessor) {
        super();
        this.downloadProcessor = downloadProcessor;
    }

    @Override
    public void handleResult(ResultContext resultContext) {
        BcmpFileInfo authors = (BcmpFileInfo) resultContext.getResultObject();
        downloadProcessor.processData(authors);
    }

}
